package com.amkai.mobile.client;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

/**
 * 
 * @author lkovari
 *
 */
public class AppMain extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.appmain);
        TextView licenseTextView = (TextView) findViewById(R.id.license);
//        licenseTextView.setTextColor(Color.YELLOW);
        
        Button acceptbutton = (Button) findViewById(R.id.accept_btn);
//        acceptbutton.setTextColor(Color.GREEN);
        acceptbutton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
//                Intent myIntent = new Intent(v.getContext(), AeMobile.class);
//                startActivityForResult(myIntent, 1965);
            	AeMobile.startMain(AppMain.this);
            }
        });

        Button refuseButton = (Button) findViewById(R.id.refuse_btn);
//        refuseButton.setTextColor(Color.RED);
        refuseButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                finish();
				System.exit(1);
            }
        });
    }
       
    
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 1965) {
            if (resultCode == Activity.RESULT_OK) {
                boolean isExit = data.getExtras().getBoolean("IS_EXIT");    	          
                if (isExit)
                	finish();
    	    }
    	}
    }
    
}